{% extends 'html/base_template.html' %}
{% load filter %}
{% block content_section %}
    <div id="id_account_info">
        {% if not supplier_info %}
            <div class="row">
                <div class="my_blockquote">
                    <p>
                        <strong>完善账户信息</strong>
                    </p>
                    <p>初次登录,请完善账户信息,通过审核后方可继续游戏上传</p>
                </div>
            </div>
        {% endif %}
        <div class="row">
            <script type="text/javascript">
                submit_account_form();
            </script>
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <form id="id_account_form" role="form" enctype="multipart/form-data"
                          class="form-horizontal"
                          method="post" action="{{ urls.submit_supplier_info }}">
                        {% csrf_token %}
                        <div class="panel-heading">
                            <h3 class="panel-title">公司信息<i class="h3_span1">请确保公司信息与合同中信息一致</i>
                            </h3>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>公司名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="company"
                                           value="{{ supplier_info.company_info.company }}">
                                    <p class="cl_red" style="display:none;">请填写正确的名称</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>法人</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"
                                           name="representative"
                                           value="{{ supplier_info.company_info.representative }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="cl_red">*</i>公司注册地址</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="reg_address"
                                           value="{{ supplier_info.company_info.reg_address }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>邮编</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="postcode"
                                           value="{{ supplier_info.company_info.postcode }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="cl_red">*</i>公司所在地址</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="region"
                                           value="{{ supplier_info.company_info.region }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>营业执照</label>
                                <div class="col-sm-10" id="id_license">
                                    {% if supplier_info.company_info.license %}
                                        <div>
                                            <a>{{ supplier_info.company_info.license }}</a>
                                            <a onclick="upload_file('id_license', 'license', 'image/*');"
                                               class="btn btn-secondary btn-sm btn-icon">点击更改</a>
                                        </div>
                                    {% else %}
                                        <input type="file" class="form-control" name="license" accept="image/*">
                                    {% endif %}
                                    <p>最新年检的营业执照副本扫描件，JPG,PNG,GIF格式的图片</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">税务登记证</label>
                                <div class="col-sm-10" id="id_tax_reg_ca">
                                    {% if supplier_info.company_info.tax_reg_ca %}
                                        <a>{{ supplier_info.company_info.tax_reg_ca }}</a>
                                        <a onclick="upload_file('id_tax_reg_ca', 'tax_reg_ca', 'image/*');"
                                           class="btn btn-secondary btn-sm btn-icon">点击更改</a>
                                    {% else %}
                                        <input type="file" class="form-control" name="tax_reg_ca" accept="image/*">
                                    {% endif %}
                                    <p>若还未三证合一，请提交税务登记证扫描件，jpg、png、gif格式的图片</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">银行开户许可证</label>
                                <div class="col-sm-10" id="id_bank_license">
                                    {% if supplier_info.company_info.bank_license %}
                                        <a>{{ supplier_info.company_info.bank_license }}</a>
                                        <a onclick="upload_file('id_bank_license', 'bank_license', 'image/*');"
                                           class="btn btn-secondary btn-sm btn-icon">点击更改</a>
                                    {% else %}
                                        <input type="file" class="form-control" name="bank_license" accept="image/*">
                                    {% endif %}
                                    <p>若还未三证合一，请提交银行开户许可证扫描件，jpg、png、gif格式的图片</p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">其他材料</label>
                                <div class="col-sm-10" id="id_others">
                                    {% if supplier_info.company_info.others %}
                                        <a>{{ supplier_info.company_info.others }}</a>
                                        <a onclick="upload_file('id_others', 'others', 'application/zip');"
                                           class="btn btn-secondary btn-sm btn-icon">点击更改</a>
                                    {% else %}
                                        <input type="file" class="form-control" name="others" accept="application/zip">
                                    {% endif %}
                                    <p>若协议中有其他约定，请提交相关材料，支持上传zip包</p>
                                </div>
                            </div>
                        </div>
                        <div class="panel-heading">
                            <h3 class="panel-title">财务信息<i class="h3_span1">请确保信息真实有效</i></h3>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>银行名称</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"
                                           name="bank_account_name"
                                           value="{{ supplier_info.finance_info.bank_account_name }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>开户银行</label>
                                <div class="col-sm-10">
                                    <select class="form-control" name="bank_name">
                                        <option>请选择银行</option>
                                        {% for key, val, title in bank_model|items_to_list %}
                                            {% if supplier_info.finance_info.bank_name == title %}
                                                <option value="{{ val }}"
                                                        selected="selected">{{ title }}</option>
                                            {% else %}
                                                <option value="{{ val }}">{{ title }}</option>
                                            {% endif %}
                                        {% endfor %}
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>银行帐户</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="bank_account"
                                           value="{{ supplier_info.finance_info.bank_account }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="cl_red">*</i>纳税人识别号</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"
                                           name="taxpayerid"
                                           value="{{ supplier_info.finance_info.taxpayerid }}">
                                </div>
                            </div>
                        </div>
                        <div class="panel-heading">
                            <h3 class="panel-title">联系人信息</h3>
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="cl_red">*</i>业务接口人姓名</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="bus_inf_name"
                                           value="{{ supplier_info.contact_info.bus_inf_name }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>联系电话</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"
                                           name="bus_telephone_no"
                                           value="{{ supplier_info.contact_info.bus_telephone_no }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>邮箱</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="bus_mail"
                                           value="{{ supplier_info.contact_info.bus_mail }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">QQ</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"
                                           name="bus_qq"
                                           value="{{ supplier_info.contact_info.bus_qq }}">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">微信</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"
                                           name="bus_wechat"
                                           value="{{ supplier_info.contact_info.bus_wechat }}">
                                </div>
                            </div>

                            <div class="form-group-separator"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="cl_red">*</i>技术接口人姓名</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="eng_inf_name"
                                           value="{{ supplier_info.contact_info.eng_inf_name }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>联系电话</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"
                                           name="eng_telephone_no"
                                           value="{{ supplier_info.contact_info.eng_telephone_no }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i
                                        class="cl_red">*</i>邮箱</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name="eng_mail"
                                           value="{{ supplier_info.contact_info.eng_mail }}">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">QQ</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"
                                           name="eng_qq"
                                           value="{{ supplier_info.contact_info.eng_qq }}">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-2 control-label">微信</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control"
                                           name="eng_wechat"
                                           value="{{ supplier_info.contact_info.eng_wechat }}">
                                </div>
                            </div>
                        </div>
                        <div class="my_button">
                            <button type="submit" class="btn btn-info btn-block my_btn_01">提交审核
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
{% endblock %}